package io.renren.modules.generator.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.modules.generator.dao.ProjectDao;
import io.renren.modules.generator.entity.ProjectEntity;
import io.renren.modules.generator.service.ProjectService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("projectService")
public class ProjectServiceImpl extends ServiceImpl<ProjectDao, ProjectEntity> implements ProjectService {


    @Autowired
    private ProjectDao projectDao;

    @Override
    public List<ProjectEntity> queryPage(Map<String, Object> params) {


        return projectDao.queryPage(params);
    }

    @Override
    public int queryPageTotal(Map<String, Object> params) {
        return projectDao.queryPageTotal(params);
    }

    @Override
    public void updateStatusByIds(List<Integer> list) {
        projectDao.updateStatusByIds(list);
    }

    @Override
    public ProjectEntity queryEntityByCode(String code) {
        return this.selectOne(new EntityWrapper<ProjectEntity>().eq(StringUtils.isNotBlank(code),"code",code));
    }

}
